#!/bin/bash 

#目录
VERSION_DIR=/home/epccadmin/update_epcc_version/EPCC_$(date +%Y%m%d)/shfile

#APP1地址
#EPCC_APP1_IP=10.192.00.137
EPCC_APP_IP=$1

#目录
EPCC_APP_DIR=/home/szfb/epcc/EPCC_FB

#菜单显示函数
dispmenu ()
{
        clear
        echo 
        echo -e "\t    ------------------------------------------------------"
        echo -e "\t    |              EPCC 灾 备 系 统                      |"
        echo -e "\t    |         当前操作环境[${EPCC_APP_IP}]                |"
        echo -e "\t    ------------------------------------------------------"
        echo -e 
        echo -e "\t  ----------------------------------------------------------"
        echo -e "\t  |               【1】.  备份并部署                       |"
        echo -e "\t  |                                                        |"
        echo -e "\t  |               【0】.  退出部署                         |"
        echo -e "\t  |                                                        |"
        echo -e "\t  ----------------------------------------------------------"
        echo -e
        echo -e "\t\t\t  >>> 输入您的选择: \c"
}

#------------------------------------------------
#  主函数入口
#------------------------------------------------
while [ 1 ]
do
        dispmenu
        read ans
        case $ans in
        0)
                exit
                ;;
                
                1)
                clear
                        ssh epccadmin@${EPCC_APP_IP} "sh ${VERSION_DIR}/epcc_update.sh ${EPCC_APP_IP}"
                        echo -e "\n\n\t 按Enter键返回主页面...\c"
                read presskey
        ;;
       esac
done